package cn.school.web;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.school.service.StudentService;

/**
 * Servlet implementation class CheckTeleServlet
 */
@WebServlet("/checkTeleServlet")
public class CheckTeleServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;

	/**
	 * @see HttpServlet#HttpServlet()
	 */
	public CheckTeleServlet() {
		super();
		// TODO Auto-generated constructor stub
	}

	StudentService s = new StudentService();

	protected void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		String tele = request.getParameter("tele");
		System.out.println(tele.substring(10));
//		try {
//			Thread.sleep(4000);
//		} catch (InterruptedException e) {
//			// TODO 自动生成的 catch 块
//			e.printStackTrace();
//		}
		// boolean f = "137".equals(tele);
		// print(f);
		response.getWriter().print(s.checkTele(tele));
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
	 *      response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		doGet(request, response);
	}

}
